package com.example.api.feign.fallback;

import com.example.api.controller.OrderController;
import com.example.api.feign.UserFeign;
import com.example.common.User;
import com.example.common.entity.ResultDO;
import com.example.common.entity.StatusCode;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

/**
 * @author meihua
 * @version 1.0
 * @date 2021/2/14 12:56
 */
@Component
public class UserFeignFallBack implements UserFeign {
    private static final Logger logger= LoggerFactory.getLogger(UserFeignFallBack.class);
    @Override
    public ResultDO<User> getUserInfo(Integer id) {
        logger.error("User 不可用 触发 服务降级  ");
        return  ResultDO.ok(new User("服务降级",id));
    }
}
